package com.imooc.ecommerce.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.imooc.ecommerce.common.TableId;
import com.imooc.ecommerce.order.OrderInfo;
import com.imooc.ecommerce.vo.SingleOrderItem;
import io.seata.spring.annotation.GlobalTransactional;

/**
 * 订单相关服务接口定义
 * @author zhangshao
 * @since 2023/12/13 23:08
 */
public interface IOrderService {

    /**
     * 下单(分布式事务): 创建订单 --> 扣减库存 -->扣减余额 -->创建物流信息(stream+kafka)
     * @param orderInfo
     * @return
     */
    TableId createOrder(OrderInfo orderInfo);

    IPage<SingleOrderItem> getSimpleOrderDetailByPage(int pageNum);
}
